import {defineStore} from "pinia";
import {ref} from "vue";

export const useRouteRootStore = defineStore('routeRoot', () => {
    let routeRootPathDataList = ref([]);
    let routeRootPathSearchData = ref({});
    let addOrUpdateDialog = ref(false);
    let deleteDialog = ref(false);

    function resetRouteRootPathDataList(info) {
        routeRootPathDataList.value = info;
    }

    function resetRouteRootPathSearchData(info) {
        routeRootPathSearchData.value = info;
    }

    function resetAddOrUpdateDialog(flag) {
        addOrUpdateDialog.value = flag;
    }

    function resetDeleteDialog(flag) {
        deleteDialog.value = flag;
    }

    return { routeRootPathDataList, resetRouteRootPathDataList, routeRootPathSearchData, resetRouteRootPathSearchData, addOrUpdateDialog, resetAddOrUpdateDialog,
        deleteDialog, resetDeleteDialog }
})